<?php
if($this->layout != 'ajax'): ?>
<script type="text/javascript" charset="utf-8">
	function hellaLink() {
		$("#results .hella").click(function(){
			var list = this.parentNode;
			var title = this.getAttribute('title');
			var offset = this.offsetTop;
			$.ajax({
				beforeSend: function(){
					$(list).addClass('queue').children('.hella').html('<?php echo $html->image('arrow-loader.gif')?>').css({height: '16px', width: '16px'});
				},
				url: this.href,
				success: function(){
					// check for success soon
					if(1) {
						$(list).html(title + ' queued');
						popup({selector: '#default_popup',
							   msg: 'Report ' + title + ' queued for download.',
							   position: offset
						});
					} else {
						alert('error uploading');
					}
				},
			});
			return false;
		});
	}
</script>
<?php echo $form->create('Newz', array('method' => 'post', 
	'action' => 'search', 
	'url' => '/newz/search', 
	'id' => 'newzForm'))?>
<div id="query_container">
	<input type="search" class="search" id="NewzQuery" name="data[Newz][query]" />
	<?php echo $form->submit('')?>
</div>

<?php echo $form->end()?>
<?php endif ?>
<?php if(!empty($items)) echo $this->renderElement('search')?>
<div id="loading_image" style="display: none">
	Loading...<?php echo $html->image('arrow-loader.gif')?>
</div>
<div id="results" style="display: none">
</div>